package com.example.compsiteid2;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {

    @EmbeddedId  //联合主键
    private UserInfoId userInfoId;

    private int age;

    @Column(unique = true)
    private String uniqueNumber;
}
